package practice;

public class Pra_04 {
    public static void main(String[] args) {
        String path = "http://localhost:8088/myweb/reg?name=zhangsan&pwd=123456&nick=san&age=16";
        path = path.substring(path.indexOf("?") + 1);
        String[] regex = {"&", "="};
        String[] params = path.split(regex[0]);
        for (String param : params) {
            String[] temp = param.split(regex[1]);
            System.out.println("参数名：" + temp[0] + "\t参数值：" + temp[1]);
        }
    }
}
